package cj.web.game.dao;

import java.util.List;
import java.util.Map;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;

/**
 * 
 * @author HanMin
 *
 * 2015年12月29日
 */
@DAO
public interface GameDAO {

	@SQL("SELECT id,img,name,startDate,endDate,type,tel,price,duration,maxApplyCount FROM Game WHERE deleteFlag=1 AND startDate <= now() AND endDate > now() ORDER BY endDate DESC ")
    List<Map> queryAllForEndDate();
	
	@SQL("SELECT * FROM Game WHERE id=:1 ")
    List<Map> queryById(int id);
	
	@SQL("SELECT id,img,name,startDate,endDate,type,tel,price,duration,maxApplyCount FROM Game WHERE deleteFlag=1 ORDER BY endDate DESC ")
    List<Map> queryAll();
	
	@SQL("SELECT id,img,name,startDate,endDate,type,tel,price,duration,maxApplyCount FROM Game WHERE deleteFlag=1 AND type=:1 ORDER BY endDate DESC ")
    List<Map> queryAll(int type);
}
